
string file = getenv("TMP1");

void pid1(){
  TFile *f = new TFile(file.c_str(), "UPDATE");
  TTree *etf = (TTree *)f->Get("etf");
  TCut cut = "";

  // --------------------- 16. Tstop Statistics ----------------------- //
  etf->Draw("pid.tof2()>>h1(500, 20., 120.)", cut);
  etf->Draw("rawvme0.adc(0,12)>>h2(500, 0., 4200.)", cut);
  etf->Draw("rawvme0.adc(0,13)>>h3(500, 0., 4200.)", cut);
  etf->Draw("rawvme0.adc(0,14)>>h4(500, 0., 4200.)", cut);
  etf->Draw("rawvme0.adc(0,15)>>h5(500, 0., 4200.)", cut);
  etf->Draw("pid.dE1():pid.hitY()>>h6(500, -40., 40., 500, 0., 4.)", cut);

  TCanvas *c1 = new TCanvas("c", "Tstop Statistics", 1680, 1050);
  c1->Divide(3,2); char h[64]; TH1 *b;
  for(int i = 0; i < 6; i++){
    sprintf(h, "h%d", i+1); f->GetObject(h,b);
    c1->cd(i+1); b->Draw("colz");
  } // end for
  c1->Print("pid1.pdf");
} // end vis
